import { getUserInfo } from '@/api/user'
const state = {
  user: {}
}
const getters = {
}
const mutations = {
  SET_USER (state, user) {
    state.user = user
  }
}
const actions = {
  setUser ({ commit }, user) {
    getUserInfo().then(res => {
      commit('SET_USER', res.data)
    })
  }
}
export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}
